1. Field of the Invention
The present invention relates to a method and apparatus for controlling a robot in which, for instance, the orbit of a robot arm or the like is controlled in accordance with a program which has previously been written and, more particularly, to realize both of the high robot controlling speed and the safe orbit in the case of continuously executing the moving operations in different directions.
2. Related Background Art
As conventional techniques regarding the realization of a high speed in the continuous operation control of a robot, the techniques shown in, for instance, JP-A-58-177289, JP-A-60-132207, JP-A-61-146487, etc. are known.
The apparatus of JP-A-58-177289 comprises means for detecting the arm position and means for comparing the detected arm position with a predetermined position which has previously been stored, wherein when the arm has passed the predetermined position, the program steps progress even during the arm operation, thereby realizing the high control speed. In more detail, according to JP-A-58-177289, the movement in the horizontal direction is executed by a DC servo motor and the movement in the vertical direction is performed by an air cylinder. A chuck or the like is connected to the tip of the air cylinder. Assuming that a target position in the horizontal direction is point D, the air cylinder is driven at the time point when the arm passes a point D' before the point D, thereby starting the downward motion. The point D' is determined by presuming from the time required until the air cylinder arrives at the lowest position.
On the other hand, the control apparatus of JP-A-60-132207 uses DC servo motors for three axes and comprises: means for detecting the arm position; means for inputting an overlap area where the next operation can be started during the present arm operation; and means for discriminating whether the arm exists in the overlap area or not, wherein when the arm is located in the overlap area, the present movement command and the next movement command overlap to realize, the high control speed. The overlap area is input by the operation of an operator. The overlap area is defined as an area near a change point of the moving direction.
On the other hand, the apparatus of JP-A-61-146487 has a vertical movement control circuit and a horizontal movement control circuit which are independent of each other, wherein the horizontal movement is started by a timing signal from the vertical movement control circuit and the vertical movement is started by a timing signal from the horizontal movement control circuit. The timing signals are output by detecting the horizontal moving velocity so that the downward movement is finished after completion of the horizontal movement. In other words, when the horizontal movement and the downward movement overlap, the horizontal movement finishes early. At the time near the end of the downward movement, only the downward movement is executed, to realize high control speed and to prevent damage, accident, or the like, to the arm.
However, in the robot control, it is not always necessary to move the robot from the present position to a target position at high speed when the robot must clear an obstacle to arrive at the target position. In other words, if the robot cannot avoid an obstacle, high control speed may not be realized. The operations of the ascent.fwdarw.horizontal movement.fwdarw.descent per se must be executed because an obstacle exists between the present position and the target position although the robot inherently can reach the target position by only the horizontal movement. Such a situation will be appreciated, in the case of assembling a completed product from a plurality of parts where the robot must be controlled in a manner such that the robot finger gripping the part avoids an enclosure encasing the part and, further, both the finger and the part grasped by the finger do not collide with the semicomplete article during the assembly.
The above three conventional examples have a feature that the horizontal movement and the vertical movement are executed together in parallel for a certain period of time. The orbit which is obtained by the parallel motions in those two directions is specified by the synthesis of the moving velocities in those directions.
For instance, FIG. 14 shows orbits of the motions in the two directions which have been described in JP-A-61-146487. It is assumed that the time required from the start of the movement in the vertical (Z axis) direction to the arrival at the target position is set to a and the time required from the movement at a velocity v.sub.0 in the horizontal (X axis) direction to the stopping of the motion is set to b and is set to a predetermined offset value so as to obtain a certain downward movement after completion of the horizontal movement. The start time of the downward movement is set to the time when the velocity in the horizontal direction becomes v. ##EQU1## The above equation is satisfied only when it is assumed that the decelerating motion in the horizontal direction can be approximated by linear motion and the value of c is set to a small value. However, as shown in FIG. 14, if an obstacle 100 exists in the orbit of the parallel motions, the robot arm will be broken. Therefore, hitherto, a temporary target position in the vertical direction is set by repeating trials and errors by the operator so that the orbit of the parallel motions is set to enable an obstacle to be avoided and, thereafter, (only) the vertical movement is executed until the final target position in the vertical direction. However, in the process of the trials and errors, a serious accident may occur such that the robot collides with a tool or a workpiece or the like because the straight line portion upon descending cannot be specified. As the easiest method for avoiding such an accident, it is sufficient to merely reduce the parallel motion time period. However, such a method is contrary to the realization of high speed. This is because according to JP-A-61-146487, it is the primary object to define the period of time for the parallel motions on the basis of the decelerating velocity in the horizontal direction and the time which is required for the motion in the vertical direction and a viewpoint such that the highspeed control is realized without the safety feature of obstacle avoidance.
In the conventional example of JP-A-58-177289, as mentioned above, since the movement in the vertical direction is executed by the air cylinder, the position control is not executed, so that the safety is further unstable as compared with JP-A-61-146487.
On the other hand, according to JP-A-60-132207, since the overlap area must be input on the basis of the perception of the operator, safety and speed may not be adequate.